<!DOCTYPE HTML>
<html>
<head>

<meta charset="utf-8">


<load href='__PUBLIC__/lib/html5.js' />
<load href='__PUBLIC__/lib/respond.min.js' />
<load href='__PUBLIC__/lib/PIE_IE678.js' />

<load href='__PUBLIC__/css/H-ui.min.css' />
<load href='__PUBLIC__/css/H-ui.admin.css' />        
<load href='__PUBLIC__/lib/Hui-iconfont/1.0.1/iconfont.css' />

<title>订单管理</title>

</head>
<body>

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 订单中心 <span class="c-gray en">&gt;</span> 订单管理 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>

<div class="pd-20">


	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<span class="r">共有数据：<strong>{$total}</strong> 条</span> 
	</div>


	<div class="mt-20">

	<table class="table table-border table-bordered table-hover table-bg table-sort">

		<thead>
			<tr class="text-c">

				<th width=""><input type="checkbox" name="" value=""></th>
				<th width="30">ID</th>
				<th width="">订单ID</th>
				<th width="">商品ID</th>
				<th width="">商品名称</th>
				<th width="">用户ID</th>
				<th width="">评论内容</th>
				<th width="">评论等级</th>
				<th width="">评论时间</th>
				<th width="">状态</th>
				<th width="">评论操作</th>			
			</tr>
		</thead>

		<tbody>
			<foreach name='list' item='val'>
			<tr class="text-c">
				<td><input type="checkbox" value="1" name=""></td>
				<td>{$val.id}</td>
				<td><u style="cursor:pointer" class="text-primary" onclick="member_show('订单详情','{:U('order?id='.$val['orderid'])}','','360','400')">{$val.orderid}</u></td>
				<td><u style="cursor:pointer" class="text-primary" onclick="member_show('商品详情','{:U('goods?id='.$val['goodsid'])}','','360','400')">{$val.goodsid}</u></td>
				<td>{$val.name}</td>
				<td><u style="cursor:pointer" class="text-primary" onclick="member_show('用户信息','{:U('user?id='.$val['userid'])}','','360','400')">{$val.userid}</u></td>
				<td>{$val.content}</td>
				<td>{$val.clevel}</td>
				<td>{$val.ctime}</td>
				<td>{$val.status}</td>
				<!--
				<td><a href="{:U('del?id='.$val['id'])}" onclick="return confirm('确定要删除吗？')">删除</a>&nbsp;&nbsp;
					<a href="{:U('reply?id='.$val['id'])}">回复</a>
				</td>
				-->
				<if condition="$val['status'] eq '已评论'">
				<td><a href="{:U('del?id='.$val['id'])}" onclick="return confirm
				('确定要删除吗？')"><span class="label label-info radius">删除</span></a>&nbsp;&nbsp;
				<a href="{:U('reply?id='.$val['id'])}"><span class="label label-danger radius">回复</span></a>
				</td>	
				
				<elseif condition="$val['status'] eq '已回复'" />
				<td><a href="{:U('del?id='.$val['id'])}" onclick="return confirm
				('确定要删除吗？')"><span class="label label-info radius">删除</span></a>&nbsp;&nbsp;
				<!--<a href="{:U('reply?id='.$val['id'])}">回复内容</a>-->
				<a onclick="member_add('回复内容','{:U('replyed?id='.$val['id'])}','500','400')"><span class="label label-success radius">回复内容</span></a>
				</td>

				<else />
				<td><a href="{:U('del?id='.$val['id'])}" onclick="return confirm
				('确定要删除吗？')">删除</a>&nbsp;&nbsp;
				</td>

				</if>

			</tr>
			</foreach>
		</tbody>

	</table>

	</div>
</div>

<load href='__PUBLIC__/lib/jquery/1.9.1/jquery.min.js' />
<load href='__PUBLIC__/lib/layer/1.9.3/layer.js' />
<load href='__PUBLIC__/lib/laypage/1.2/laypage.js' />

<load href='__PUBLIC__/lib/My97DatePicker/WdatePicker.js' />
<load href='__PUBLIC__/lib/datatables/1.10.0/jquery.dataTables.min.js' />        
<load href='__PUBLIC__/js/H-ui.js' />
<load href='__PUBLIC__/js/H-ui.admin.js' />

<script type="text/javascript">

$(function(){
	$('.table-sort').dataTable({
		"aaSorting": [[ 1, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0,8,9]}// 制定列不参与排序
		]
	});
	$('.table-sort tbody').on( 'click', 'tr', function () {
		if ( $(this).hasClass('selected') ) {
			$(this).removeClass('selected');
		}
		else {
			table.$('tr.selected').removeClass('selected');
			$(this).addClass('selected');
		}
	});
});
/*用户-添加*/
function member_add(title,url,w,h){
	layer_show(title,url,w,h);
}
/*用户-查看*/
function member_show(title,url,id,w,h){
	layer_show(title,url,w,h);
}

/*用户-编辑*/
function member_edit(title,url,id,w,h){
	layer_show(title,url,w,h);
}
/*密码-修改*/
function change_password(title,url,id,w,h){
	layer_show(title,url,w,h);	
}
/*用户-删除*/
function member_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$(obj).parents("tr").remove();
		layer.msg('已删除!',{icon:1,time:1000});
	});
}
</script> 
</body>
</html>
